﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="QLPhanHoiKH.aspx.cs" Inherits="Admin_QLPhanHoiKH" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" language="javascript">
    function SelectAll(id) {
        //get reference of GridView control
        var grid = document.getElementById("<%=gvDanhGia.ClientID%>");
        //variable to contain the cell of the grid
        var cell;

        if (grid.rows.length > 0) {
            //loop starts from 1. rows[0] points to the header.
            for (i = 0; i < grid.rows.length; i++) {
                //get the reference of first column
                cell = grid.rows[i].cells[4];
                //loop according to the number of childNodes in the cell
                for (j = 0; j < cell.childNodes.length; j++) {
                    //if childNode type is CheckBox                 
                    if (cell.childNodes[j].type == "checkbox") {
                        //assign the status of the Select All checkbox to the cell checkbox within the grid
                        cell.childNodes[j].checked = document.getElementById(id).checked;
                    }
                }
            }
        }
    }
    function clickButton(e, buttonid) {
        var evt = e ? e : window.event;
        var bt = document.getElementById(buttonid);

        if (bt) {
            if (evt.keyCode == 13) {
                bt.click();
                return false;
            }
        }
    }
    function NewWindow() {
        document.forms[0].target = "_blank";
    }
    </script>
    <style type="text/css">
        .style2
        {
            height: 38px;
        }
        .style4
        {
            height: 150px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
        <table width="100%">
            <!--<tr><td align="center"><p style="font-size:12pt">Danh Sách Phản Hồi Về Sản Phẩm</p>
                <p style="font-size:12pt">
                    &nbsp;</p>
                </td></tr>-->
            <tr align="center">
            <td>
            <asp:GridView ID="gvPhanHoi" runat="server" AutoGenerateColumns="False" 
                         Width="800px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaSP" 
                    PageSize="5" onpageindexchanging="gvPhanHoi_PageIndexChanging" 
                    onrowcommand="gvPhanHoi_RowCommand" onrowdatabound="gvPhanHoi_RowDataBound" 
                    onrowdeleting="gvPhanHoi_RowDeleting" onrowediting="gvPhanHoi_RowEditing">
                        <Columns>
                            <asp:BoundField DataField="MaPH" HeaderText="Mã Phản Hồi" 
                                SortExpression="MaPH" >
                            <ItemStyle Width="30px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="MaSP" HeaderText="Mã SP" 
                                SortExpression="MaSP" >
                            <ItemStyle Width="20px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Tên SP" DataField="TenSP" SortExpression="TenSP" >
                            <ItemStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Nội Dung" DataField="NoiDung" 
                                SortExpression="NoiDung">
                            <ItemStyle Width="100px" HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Tình Trạng">
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" 
                                        Checked='<%# Eval("DaKiemTra") %>' />
                                </ItemTemplate>
                                <ItemStyle Width="50px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                    
                                    <asp:LinkButton ID="LinkButton2" CssClass="btnicon2" runat="server" 
                                        CommandName="Delete" 
                                        OnClientClick="return confirm('B&#7841;n c&oacute; ch&#7855;c ch&#7855;n mu&#7889;n x&oacute;a sản phẩm n&agrave;y không?');" 
                                        ToolTip="Xóa"></asp:LinkButton>
                                        <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Trả Lời Phản Hồi " 
                                        CommandArgument='<%# Eval("MaSP") %>'></asp:LinkButton>
                                    <!--<asp:LinkButton ID="LinkButton3" CssClass="btnicon3" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" CssClass="btnicon4" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server"></asp:LinkButton>-->
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="170px" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>
                <br />
            </td>
            </tr>
            <tr><td align="center"><p style="font-size:12pt">Danh Sách Đánh Giá Sản Phẩm</p>
            <br />
                Nội Dung - Tiêu Đề :
                <asp:TextBox ID="txtduyet" runat="server"></asp:TextBox>
                <asp:Button ID="btduyet"
                    runat="server" Text="Tìm" onclick="btduyet_Click" Height="25px" 
                    Width="50px" />
                <br />
                <br />
                </td></tr>
                    <tr align="center"><td>
                        <asp:GridView ID="gvDanhGia" runat="server" AutoGenerateColumns="False" 
                         Width="800px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaSP" 
                    PageSize="5" onrowdatabound="gvDanhGia_RowDataBound" 
                            onrowdeleting="gvDanhGia_RowDeleting" 
                            onpageindexchanging="gvDanhGia_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="MaDG" HeaderText="Mã Đánh Giá" 
                                SortExpression="MaDG" >
                            <ItemStyle Width="40px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TieuDe" HeaderText="Tiêu Đề " 
                                SortExpression="TieuDe" >
                            <ItemStyle Width="130px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Tên Sản Phẩm" DataField="TenSP" 
                                SortExpression="TenSP" >
                            <ItemStyle Width="150px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Nội Dung" DataField="NoiDung" 
                                SortExpression="NoiDung">
                            <ItemStyle Width="200px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Chọn">
                                
                                
                                
                                <ItemTemplate>
                                    <div style="vertical-align:middle;margin-left:10px;">
                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" 
                                            CssClass="btnicon2" 
                                            OnClientClick="return confirm('Bạn có chắc chắn muốn xóa đánh giá này không?');" 
                                            ToolTip="Xóa đánh giá"></asp:LinkButton>
                                        <!--<asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Trả Lời Phản Hồi " 
                                        CommandArgument='<%# Eval("MaSP") %>'></asp:LinkButton>-->
                                        <!--<asp:LinkButton ID="LinkButton3" CssClass="btnicon3" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" CssClass="btnicon4" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server"></asp:LinkButton>-->
                                    </div>
                                </ItemTemplate>
                                
                                
                                
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="170px" />
                                
                                
                                
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>
                    <br />
                        <asp:Label ID="blKQDanhGia" runat="server" Text="" ForeColor="Red"></asp:Label>
                    </td></tr>
        </table>
        </asp:View>
        <asp:View ID="View2" runat="server">
        <table align="center" style="margin">
        <tr>
            <td class="style2">Email:</td>
            <td class="style2">
                <asp:TextBox ID="txtEmail" runat="server" ReadOnly="True" CssClass="inp-form"></asp:TextBox></td>
        </tr>
        <tr>
        <td class="style4">Nội Dung:</td>
        <td class="style4">
            <asp:TextBox ID="txtNoiDung" runat="server" Height="130px" Width="240px" ReadOnly="True" TextMode="MultiLine"></asp:TextBox></td>
        </tr>
        <tr><td>Ý Kiến:</td>
        <td>
            <asp:TextBox ID="txtYKien" runat="server" Height="65px" Width="236px" 
                TextMode="MultiLine"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                    runat="server" ErrorMessage="*" ControlToValidate="txtYKien" 
                ForeColor="Red"></asp:RequiredFieldValidator></td>
        </tr>
        <tr><td>
                        <asp:HiddenField ID="hdmaph" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="btguiykien" runat="server" Text="G&#7917;i Ý Ki&#7871;n" Width="76px" 
                            onclick="btguiykien_Click" />
                    </td></tr>
        </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>

